#Include "Protheus.ch"

User Function AltCCSRC()

dbSelectArea("SRC")
SRC->(dbSetOrder(1))
SRC->(dbGoTop())

While SRC->(!Eof())

	IF !(RTrim(SRC->RC_PD) $ "443/075/086/070/455")
		SRC->(dbSkip())
		Loop
	EndIF
	
	IF !Empty(SRC->RC_CC)
		SRC->(dbSkip())
		Loop
	EndIF
	
	dbSelectArea("SRA")
	SRA->(dbSetOrder(1))  // RA_FILIAL+RA_MAT

	IF SRA->(dbSeek(xFilial("SRA") + SRC->RC_MAT))
		RecLock("SRC", .F.)
			SRC->RC_CC := SRA->RA_CC
		MSUnLock()
	EndIF
	
	SRC->(dbSkip())

End

Return Nil